import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { DataPermission } from '../domain/sparrow';

@Injectable({
  providedIn: 'root'
})
export class DataPermissionService {


  host:string = "http://localhost:8091/api";

  constructor(private httpClient: HttpClient) { }

  public addPermission(dataPermission: DataPermission){
    return this.httpClient.post<any>(this.host + "/dataPermissions/batch", dataPermission);
  }

  public delPermission(dataPermission:DataPermission){
    return this.httpClient.delete<any>(this.host + "/dataPermissions/batch", {body:dataPermission});
  }

}
